<!-- extends继承 -->
{% extends 'layout.html' %} 
{% block main %}
    <ol class="breadcrumb">
	  <li><a href="/">管理首页</a></li>
	  <li><span>内容列表</span></li>
	</ol>
	{%include 'page.html'%}
	<h3>内容首页</h3>
	<table class="table table-hover table-striped">
	  <tr>
	    <th>ID</th>
	    <th>分类名称</th>
	    <th>标题</th>
	    <th>作者</th>
	    <th>添加时间</th>
	    <th>阅读量</th>
	    <th>操作</th>
	  </tr>
	  <!-- 遍历对象 -->
	  {% for content in contents %}
	  <tr>
	    <td>{{content._id.toString()}}</td>
	    <td>{{content.category.name}}</td>
	    <td>{{content.title}}</td>
	    <td>{{userInfo.username}}</td>
	    <td>{{content.addTime|date('Y-m-d H:i:s',-8*60)}}</td>
	    <td>{{content.views}}</td>
	    <td>
	      <a href="/admin/content/edit?id={{content._id.toString()}}">编辑</a> |
	      <a href="/admin/content/delete?id={{content._id.toString()}}">删除</a>
	    </td>
	  </tr>
	  {% endfor %}
	</table>
	<!-- //分页 -->
	<!-- 把页面包含进来 -->
	{%include 'page.html'%}
{% endblock%}